<?php
	include("include/db.inc");
	include("include/torrents.inc");
	
	session_start();

	if($_SESSION["logged"] == false)
	{
		header("Location: login.php");
		exit();
	}
		
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" 
>
<html>
  <head>
    <title>QTracker</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  </head>
  <body>
    <table>
      <tbody>
        <tr>
          <td>
            <b><?php echo $_SESSION["name"]; ?></b>
          </td>
        </tr>
        <tr>
          <td>
            <b><?php echo $_SESSION["email"]; ?></b>
          </td>
        </tr>		
		<tr>
          <td>
            <a href="script/logout.php">Logout</a>
          </td>
        </tr>	
      </tbody>
    </table>
    <br />
		Vaš lični QTracker announce URL je: <b>http://localhost:23982/<?php echo $_SESSION["passkey"]; ?>/announce</b>
	<br />
	<br />
    <div align="center">
      <table  style="border:1px solid #000000; width:60%;">
        <tbody>
          <tr>
            <td>
               Torrent name 
            </td>
            <td style="width:80px;">
               Size 
            </td>
            <td style="width:200px;">
               Date added 
            </td>
            <td style="width:100px;">
               Uploaded by 
            </td>
          </tr>
          <?php print_torrents(); 
          ?>
        </tbody>
      </table>
      <br/>
      <br/>
      <br/>
       Ovaj PHP portal služi samo za potrebe testiranja aplikacije QTracker i sadrži samo najosnovniju funkcionalnost za listanje i download torrent fajlova. 
    </div>
  </body>
</html>
